class DecodeCsvDemo:
    # Search keys & Attribute keys for analysis, the others will be decode as test item.
    # Please input the full name
    __SEARCH_KEYS = ['Serial Number', 'Station ID', 'Site ID', 'Test PASS/FAIL STATUS',
                     'List of Failing Tests', 'Test Start Time', 'Test Stop Time']
    __ATTRIBUTE_KEYS = []

    # Line NO. settings, starting from 1.
    # The line NO. of the test item names
    __TEST_ITEM_NAME_INDEX = 2

    # The line NO. of the USL, LSL, Measure unit
    __USL_INDEX = 3
    __LSL_INDEX = 4
    __MEASURE_UNIT_INDEX = 5

    # The line NO. where the data row start
    __DATA_START_INDEX = 6

    # The flag for auto-generating item names
    # True means application will generate the item name automatically when it's empty.
    # False mean close this function and application will ignore the empty name.
    __IS_AUTO_GENERATE_ITEM_NAME = True

    def get_search_keys(self):
        return self.__SEARCH_KEYS

    def get_attribute_keys(self):
        return self.__ATTRIBUTE_KEYS

    def get_param_row(self, line_no, row):
        min_index = min(self.__USL_INDEX, self.__LSL_INDEX, self.__MEASURE_UNIT_INDEX)
        max_index = max(self.__USL_INDEX, self.__LSL_INDEX, self.__MEASURE_UNIT_INDEX)
        if (line_no < min_index):
            return "Continue"
        if (line_no == self.__USL_INDEX):
            return "UL"
        if (line_no == self.__LSL_INDEX):
            return "LL"
        if (line_no == self.__MEASURE_UNIT_INDEX):
            return "MU"
        if (line_no > max_index):
            return "Stop"

    def get_column_name_index(self, line_no, row):
        if (line_no == self.__TEST_ITEM_NAME_INDEX):
            return True
        else:
            return False

    def get_data_row(self, line_no, row):
        if (line_no < self.__DATA_START_INDEX):
            return False
        else:
            return True

    def get_item_name_generator_flag(self):
        return self.__IS_AUTO_GENERATE_ITEM_NAME
